<template>
  <div>
    <echarts-view />
    <div class="servers">
      <head-title title="服务机构" :bg-numb="7"/>
      <swiper :options="swiperOptions" ref="mySwiper" class="swiper-server">
        <template v-for="(item, index) in serverList">
          <swiper-slide>
            <div class="server-item" :class="[
                swiperIndex === index && 'first',
                swiperIndex + 3 === index && 'last'
                ]">
              <div class="logo text-center">
                <img width="42px" height="42px" :src="require(`../assets/img/server-logo/${item.img}.png`)">
              </div>
              <p class="title">{{ item.title.substr(0, 7) }}</p>
            </div>
          </swiper-slide>
        </template>
      </swiper>
    </div>
  </div>
</template>

<script>
import {swiper, swiperSlide } from 'vue-awesome-swiper'
import HeadTitle from '../components/HeadTitle'
import EchartsView from './echartsView'
export default {
  name: "LeftView",
  data() {
    const that = this
    return {
      swiperIndex: 1,
      swiperOptions: {
        direction: 'horizontal',//水平(horizontal)或垂直(vertical)。
        loop: false,
        autoplay: {
          delay: 2000,
          disableOnInteraction: false
        },
        stopOnLastSlide: true,
        slidesPerView: 4,
        initialSlide: 0,
        disableOnInteraction: false,
        observer: true,
        observeParents: false,
        on: {
          // eslint-disable-next-line no-unused-vars
          slideChangeTransitionEnd(data) {
            that.swiperIndex = this.activeIndex
          }
        },
      },
      serverList: [
        {
          title: '中国农业银行',
          img: '1'
        },
        {
          title: '中国民生银行',
          img: '2'
        },
        {
          title: '中国建设银行',
          img: '3'
        },
        {
          title: '中国工商银行',
          img: '4'
        },
        {
          title: '华夏银行',
          img: '5'
        },
        {
          title: '成都农商银行',
          img: '6'
        },
        {
          title: '成都银行',
          img: '7'
        },
        {
          title: '北京中金浩资产评估有限责任公司',
          img: '8'
        },
        {
          title: '成都中小企业融资担保有限责任公司',
          img: '9'
        },
        {
          title: '成都知识产权教育中心有限公司',
          img: '10'
        }
      ]
    }
  },
  computed: {
    className() {
      return ''
    }
  },
  components: {
    HeadTitle,
    EchartsView,
    Swiper: swiper,
    SwiperSlide: swiperSlide
  }
}
</script>

<style lang="scss">
@import '../assets/css/gobal';
.servers {
  position: relative;
  box-sizing: border-box;
  padding: 0 20px 0 28px;
  width: 909px;
  height: 162px;
  background-image: url("../assets/img/bigScreenNew/servers-bg.png");
  background-repeat: no-repeat;
  color: #b0e3fb;
  .server-item {
    position: relative;
    box-sizing: border-box;
    margin-top: 63px;
    padding-left: 70px;
    //width: 201px;
    width: 100%;
    height: 69px;
    background-image: url("../assets/img/bigScreenNew/server-content.png");
    background-repeat: no-repeat;
    .logo {
      position: absolute;
      width: 42px;
      height: 42px;
      top: 50%;
      left: 15px;
      transform: translateY(-50%);
      border-radius: 50%;
    }
    .title {
      line-height: 69px;
      @include text-overflow();
    }
    &.first {
      background-image: url("../assets/img/bigScreenNew/server-first.png");
    }
    &.last {
      background-image: url("../assets/img/bigScreenNew/server-last.png");
    }

  }
}
</style>
